/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package db;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author pelle
 * 
 * 21-06-2011, Pelle: Added getTeamCount()
 */
public class TeamDb extends AbstractDb implements TeamInterface {

    public int getTeamCount() {
        int count = 0;
        ResultSet rs = this.db.query("SELECT COUNT(*) AS count FROM Lif_Team");
        
        try {
            if(rs != null && rs.next()) {
                count = rs.getInt("count");
            }
        } catch (SQLException ex) {
            Logger.getLogger(PersonDb.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        return count;
    }
    
}
